/**
 * @param {string} s
 * @return {string}
 */
var reformat = function (s) {
  let numberStr = '', charStr = ''
  for (const c of s) {
    if (c >= '0' && c <= '9') {
      numberStr += c
    } else charStr += c
  }

  if (Math.abs(numberStr.length - charStr.length) >= 2) return ""
  let res = ''
  let j = 0, k = 0
  if (charStr.length >= numberStr.length) {
    for (let i = 0; i < charStr.length + numberStr.length; i++) {
      if (i % 2 == 0) {
        res += charStr[j]
        j++
      } else {
        res += numberStr[k]
        k++
      }

    }
  } else {
    for (let i = 0; i < charStr.length + numberStr.length; i++) {
      if (i % 2 == 0) {
        res += numberStr[j]
        j++
      } else {
        res += charStr[k]
        k++
      }

    }


  };

  return res
}

reformat("a0b1c2")